package main

import (
	"fmt"
	"time"
)

func main() {
	an := []string{"a"}
	for _, s := range an {
		an = append(an, "b")
		fmt.Println(s)
	}
	fmt.Println(an)

	v := []int{1, 2, 3}
	v = v[0:2]
	for _ = range v {
		v = []int{1,2}
		fmt.Println(v)
	}
	fmt.Println(v)

	fmt.Println("----------------")

	newAddrMap := make(map[string]bool)
	newAddrMap["aaa"] = true
	newAddrMap["bbb"] = true
	newAddrMap["ccc"] = false
	for b := range newAddrMap {
		fmt.Println(b)
	}

	fmt.Println("----------------")

	a := []int{1, 2, 3, 4}
	for _, i := range a {
		go func() {
			time.Sleep(2 * time.Second)
			fmt.Println("go:", i)
		}()
		time.Sleep(1 * time.Second)
		fmt.Println(i)
	}
}
